<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text">
    <label id="numlabel"></label>
    <button id="refresh">看不清</button>
</body>
<script>
    var lb = document.getElementById("numlabel");
    var btn = document.getElementById("refresh");
    var generate = function ()
    {
        var num = Math.round(Math.random() * 10000);
        if(num < 1000)
            num = generate();
        return num;
    }

    lb.innerText = generate();

    btn.onclick = function() {
        lb.innerText = generate();
    }
</script>
</html>